/*
 * @Description: 找回密码
 * @Author: iamsmiling
 * @Date: 2021-06-13 16:04:03
 * @LastEditTime: 2021-06-13 16:13:32
 */
import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/components/button/captcha_button.dart';
import 'package:credit_business_circle/pages/login/find_password/find_password_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class FindPasswordPage extends GetView<FindPasswordController> {
  const FindPasswordPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Theme(
      data: Theme.of(context).copyWith(
          inputDecorationTheme: InputDecorationTheme(
        border: UnderlineInputBorder(
            borderSide: BorderSide(color: R.color.ffdddddd, width: .5)),
        focusedBorder: UnderlineInputBorder(
            borderSide: BorderSide(color: R.color.ffdddddd, width: .5)),
        enabledBorder: UnderlineInputBorder(
            borderSide: BorderSide(color: R.color.ffdddddd, width: .5)),
        errorBorder: UnderlineInputBorder(
            borderSide: BorderSide(color: R.color.ffdddddd)),
      )),
      child: Scaffold(
        backgroundColor: R.color.ffffffff,
        appBar: AppBar(
          elevation: 1,
          title: Text(
            "找回密码",
            style: TextStyle(color: R.color.ff444444),
          ),
          backgroundColor: R.color.fffcfcfc,
          iconTheme: IconThemeData(color: R.color.ff222222),
        ),
        body: SingleChildScrollView(
          child: Container(
            margin: EdgeInsets.symmetric(horizontal: R.dimen.dp36),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Container(
                  margin: EdgeInsets.only(top: R.dimen.dp80),
                  child: TextFormField(
                    decoration: InputDecoration(
                        hintText: "请输入手机号码",
                        prefixIconConstraints: BoxConstraints(
                            minWidth: R.dimen.dp12 * 3,
                            maxWidth: R.dimen.dp12 * 3,
                            minHeight: R.dimen.dp12 * 3,
                            maxHeight: R.dimen.dp12 * 3),
                        prefixIcon: Padding(
                          padding: EdgeInsets.only(
                            right: R.dimen.dp5,
                          ),
                          child: Image.asset(R.image.registerMobile),
                        )),
                  ),
                ),
                Container(
                  margin: EdgeInsets.only(top: R.dimen.dp36),
                  child: TextFormField(
                    decoration: InputDecoration(
                        hintText: "请输入手机验证码",
                        prefixIconConstraints: BoxConstraints(
                            minWidth: R.dimen.dp12 * 3,
                            maxWidth: R.dimen.dp12 * 3,
                            minHeight: R.dimen.dp12 * 3,
                            maxHeight: R.dimen.dp12 * 3),
                        prefixIcon: Padding(
                          padding: EdgeInsets.only(
                            right: R.dimen.dp5,
                          ),
                          child: Image.asset(R.image.captcha),
                        ),
                        suffixIconConstraints: BoxConstraints(
                            maxHeight: R.dimen.dp56,
                            minHeight: R.dimen.dp48,
                            minWidth: R.dimen.dp84,
                            maxWidth: R.dimen.dp108),
                        suffixIcon: Container(
                          alignment: Alignment.centerRight,
                          child: CaptchaButton(
                            countBuilder: (BuildContext context, int i) {
                              return Container(
                                padding: EdgeInsets.symmetric(
                                    // horizontal: R.dimen.dp13,
                                    vertical: R.dimen.dp8),
                                decoration: BoxDecoration(
                                    borderRadius:
                                        BorderRadius.circular(R.dimen.sp16),
                                    color: R.color.transparent),
                                child: Text(
                                  "$i秒后重新发送",
                                  style: TextStyle(
                                      fontSize: R.dimen.sp12,
                                      color: R.color.ff1bbf8e),
                                ),
                              );
                            },
                            textBuilder: (BuildContext context) {
                              return Container(
                                padding: EdgeInsets.symmetric(
                                    horizontal: R.dimen.dp13,
                                    vertical: R.dimen.dp8),
                                decoration: BoxDecoration(
                                    borderRadius:
                                        BorderRadius.circular(R.dimen.sp16),
                                    color: R.color.ff1bbf8e),
                                child: Text(
                                  "获取验证码",
                                  style: TextStyle(
                                      fontSize: R.dimen.sp12,
                                      color: R.color.ffffffff),
                                ),
                              );
                            },
                          ),
                        )),
                  ),
                ),
                Container(
                  margin: EdgeInsets.only(top: R.dimen.dp36),
                  child: TextFormField(
                    decoration: InputDecoration(
                        hintText: "请设置登录密码",
                        prefixIconConstraints: BoxConstraints(
                            minWidth: R.dimen.dp12 * 3,
                            maxWidth: R.dimen.dp12 * 3,
                            minHeight: R.dimen.dp12 * 3,
                            maxHeight: R.dimen.dp12 * 3),
                        prefixIcon: Padding(
                          padding: EdgeInsets.only(
                            right: R.dimen.dp5,
                          ),
                          child: Image.asset(R.image.registerLock),
                        )),
                  ),
                ),
                Container(
                  margin:
                      EdgeInsets.only(top: R.dimen.dp45, bottom: R.dimen.dp70),
                  child: ElevatedButton(
                    child: Text("提交"),
                    onPressed: () {},
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
